package com.phiture.erp.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@Getter
@AllArgsConstructor
public enum PurchaseOrderMergeTypeEnum {
    THE_EARLIEST_TIME( "the_earliest_time",   "采购时间最早"),
    THE_LATEST_TIME( "the_latest_time",  "采购时间最晚"),
    THE_SAME_TIME( "the_same_time",  "采购时间相同");

    private final String type;
    private final String desc;

    private static  final Map<String, PurchaseOrderMergeTypeEnum> TYPE_MAP = new HashMap<>(4);

    static {
        for (PurchaseOrderMergeTypeEnum configEnum : values()) {
            TYPE_MAP.put(configEnum.type, configEnum);
        }
    }

    public static PurchaseOrderMergeTypeEnum fromType(String type){
        return TYPE_MAP.get(type);
    }

}
